import { createApp } from "vue";
import { createPinia } from "pinia";
// 引入持久化插件
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";

import pinia from "@/stores";
// 将插件提供给store实例
pinia.use(piniaPluginPersistedstate);

import { Icon } from "vant";
import App from "./App.vue";
import router from "./router";
import { Lazyload } from "vant";
// 引入全局样式
// import "./scss/index.scss";

//引入函数组件
// Toast
import "vant/es/toast/style";
// Dialog
import "vant/es/dialog/style";
// Notify
import "vant/es/notify/style";
// ImagePreview
import "vant/es/image-preview/style";

// 引入路由守卫
import "@/service/permission";

const app = createApp(App);

// 开启组件懒加载
app.use(Lazyload, {
  lazyComponent: true,
});
app.use(pinia);
app.use(router);
app.use(Icon);

app.mount("#app");
